<div class="order">
	<div class="nav">
		<div event-click="{{'$Event.user.achs.getAllAchs'}}" event-click-change="{{'$Event.changeType'}}" class="nav-li {{typeNum==1&&'focus'}}" data="1">所有订单</div>
		<div event-click="{{'$Event.user.achs.getWeiZhiFu'}}" event-click-change="{{'$Event.changeType'}}" class="nav-li {{typeNum==2&&'focus'}}" data="2">未支付订单</div>
	</div>
	<hr />
	<div class="orders">
	{{#each user.achs}}
		<user_ach></user_ach>
	{{/each}}
	</div>

	<pagination
	 id="turn-page"
	 page-info="$Cache.user.achs.page_info"
	 ></pagination>
</div>

<xmp type="tag" name="user_ach">
    <div class="order-box">
		<div class="title">
			<a href="/pay-beta.html#?ach_id={{_id}}">订单号：{{_id}}</a>（商家：{{info.bus_id}}）
		</div>
		<div class="detail">
	    	<div class="goods">
	    		{{#each info.goods_info}}
	    		<div class="goods-item">
			        <!-- w:100px h:100px -->
			        <div class="goods-image">
			            <a style="color:#1ba1e2;" href="/goods-details.html?id={{goods._id}}"><img  bind-src="{{goods.preview_img_url}}?imageView/1/w/36/h/36"></a>
			        </div>
			        <div class="goods-info-item">
			        <a href="/goods-details.html?id={{goods._id}}#default/comments">{{goods.goods_name}}</a>（X {{num}}）</div>
		       	 </div>
			{{/each}}
	    	</div>
	        <div class="price">
	            <div class="price-item first">总花费额：{{cash}}</div>
	            <div class="price-item">下单时间：{{#Time create_time,'YYYY-MM-DD HH:mm:ss'}}</div>
	        </div>
	        {{#> "user_ach_controller"}}
	    </div>
    </div>
</xmp>

<script type="text/vm">
    function(vm){
        require(['common','jQuery'],function(){
            App.set('typeNum','1');
            App.set('$Event.changeType',function(){
                App.set('typeNum',$(this).attr('data'));
            })
        })
    }
</script>